Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amTimeAgo pipe updates it's output when locale changes #188

Merged
merged 1 commit into from
Mar 11, 2018

Conversation

lukasz-kusnierz
Copy link

TimeAgoPipe updates it's output only when it detects it's input has changed.
To do so, it does extract and compare a timestamp (milliseconds).
The output, however, depends not only on milliseconds, but also on locale. That was not taken into account.

I hereby propose a pull request that fixes this.
Locale setting for current moment instance is now considered. If you change locale globally (moment.locale(...)) you will need to make sure new moment instance will trigger the pipe. I consider this the most predictable behaviour.

Please let me know your view, or suggest further changes. Thank you!

Resolves #172.

@urish urish merged commit 3ff85a8 into urish:master Mar 11, 2018
@urish
Copy link
Owner

urish commented Mar 11, 2018

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscribe to locale changes
2 participants